<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        for(;;){
            let xz = prompt(`请选择+、-、*、/；如果输入q则退出`)
            //结束循环
            if(xz=='q'){
                break
            }else if(xz=='+'){
                let num1 = +prompt('请输入数值1')
                let num2 = +prompt('请输入数值2')
                alert(num1+num2)
            }else if(xz=='-'){
                let num1 = +prompt('请输入数值1')
                let num2 = +prompt('请输入数值2')
                alert(num1-num2)
            }else if(xz=='*'){
                let num1 = +prompt('请输入数值1')
                let num2 = +prompt('请输入数值2')
                alert(num1*num2)
            }else if(xz=='/'){
                let num1 = +prompt('请输入数值1')
                let num2 = +prompt('请输入数值2')
                alert(num1/num2)
            }
        }
    </script>
</body>
</html>